#define CONTROL A0
#define RELAY 6

void setup() {
  pinMode(CONTROL,INPUT);
  pinMode(RELAY,OUTPUT);
  
}


void loop() {
    if(analogRead(CONTROL) <= 500){
    digitalWrite(RELAY,HIGH);
  }else{
    digitalWrite(RELAY,LOW);
  }
}
